package com.scott.cloud;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.scott.cloud.entity.User;

@FeignClient("microservice-provider-user")
public interface UserFeignClient {
	
	/**
	 * 两个坑：
	 * 1）GetMapping不支持，只支持RequestMapping注解，这个问题已经修复
	 * 2）PathVariable一定要设置value，否则报错
	 */
	@GetMapping("/simple/{id}")
	public User findById(@PathVariable("id") Long id);
	
	@PostMapping("/user")
	//@RequestMapping(value="/user", method=RequestMethod.POST)
	public User postUser(@RequestBody User user);
	
}
